Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🛠️ 작업 내용
현재 결제 성공, 실패는 올바르게 동작하는 것 확인했습니다.
또한 엔티티의 경우도 우선 toss_payment 엔티티 따로 추가를 했습니다.(검색간에 order 테이블과 tosstable)을 사용해서 구현하는 경우가 많고 저희는 현재 order가 따로 없기에 payment 테이블에서 우선 쿠폰 적용 가격, origin price 등 기존 결제 정보 포함하고 있고
tossPayment의 경우 엔티티 참고하시면 될 것 같습니다!
yml 파일의 경우
우선 결제 부분에 중점을 둬서


를 통해서 결제(/prepare)를 우선 진행 후(여기서 payment 테이블에 저장됨) -> 프론트에서 토스 페이 화면을 띄워주게 되면 -> (/saveAmount) 를 통해 세션에 값을 저장 후 -> 프론트 단에서 결제 성공 시 -> (/verifyAmount)를 통해서 백엔드에서 한번 더 검증 후 -> /confirm 을 통해 DB에 tosspayment 테이블에도 값이 저장되게 됩니다.
그리고 쿠폰 적용 부분은 우선 낙관적 락 적용을 하였으며 추후 변경 필요할 시 수정하면 될 것 같습니다.
이번 pr 이후 쿠폰 올바르게 적용 테스트와 서비스 내부 로직 리펙토링 작업 등 진행하겠습니다...
✅ PR 유형
✅ Check List
🔗 관련 이슈
💬 기타 참고 사항
추후에 결제 조회 로직도 같이 추가하겠습니다, 쿠폰의 경우도 같이 생성 후 쿠폰 repository에 반영이 잘 되는지 확인하면 될 것 같습니다.